import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_plugin_1/flutter_plugin_1.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  FlutterPlugin_1 flutterPlugin_1 = FlutterPlugin_1();
  bool result ;

  @override
  void initState() {
    super.initState();

  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {

  }

  Future<Null> uninstall() async {
    try {
      result = await flutterPlugin_1.uninstall({"flutter":"com.tencent.mm"});

    } on PlatformException {
      print("Failed to get uninstall");
    }
    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: <Widget>[
          RaisedButton(onPressed: initPlatformState,
          child: Text("initPlatformState")),

            RaisedButton(onPressed: uninstall,
            child: Text("卸载 微信"),)

          ],
        ),
      ),
    );
  }
}
